/*  
  -- The Lime II Project -- 

  A tuplespaces-based middleware for coordinating agents and mobile hosts.
  Copyright (C) 2005.
  Gian Pietro Picco, Amy L. Murphy, Lorenzo Bellini.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  Lesser General Public License for more details.

  You should have received this copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
*/

package lime2;

/**
 * Tags classes (usually IDs) that are used as keys in Hashtables.
 * 
 * @author Gian Pietro Picco
 * @author Amy Murphy
 * @author Lorenzo Bellini
 */

interface HashID 
{
 /**
  * The general contract of hashCode is: 
  * <P>
  * &#9679 whenever it is invoked on the same object more than once during an execution of a Java application, the 
  * hashCode method must consistently return the same integer, provided no information used in equals comparisons on 
  * the object is modified. This integer need not remain consistent from one execution of an application to another 
  * execution of the same application 
  *	<br>
  * &#9679 if two objects are equal according to the equals(Object) method, then calling the hashCode method on each 
  * of the two objects must produce the same integer result 
  *	<br>
  * &#9679 it is not required that if two objects are unequal according to the equals(java.lang.Object) method, then 
  * calling the hashCode method on each of the two objects must produce distinct integer results. However, the 
  * programmer should be aware that producing distinct integer results for unequal objects may improve the 
  * performance of hashtables
  * </P>
  * 
  * @return hashcode 	
  */
 abstract public int hashCode();
 
 /** 
  * It is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain
  * the general contract for the hashCode method, which states that equal objects must have equal hash codes. 
  *
  * return <code>true</code> or <code>false</code>
  */
 abstract public boolean equals(Object o); 
  
}
